(function($, document) {
	//header渲染
	$("h1.mui-title")[0].innerText = "个人中心"
	
	//VUE
	var vm = new Vue({
		data:{
			username:"张飞"
		},
		mounted(){
			//等级进度条
			$("#gradeProgress").progressbar({progress:20}).show();
		},
		methods:{
			//修改密码
			resetpass:function(){
				$.prompt('','请输入旧密码','修改密码',['取消','确认'],callback,'div')
				document.querySelector('.mui-popup-input input').type='password' 
				document.querySelector('.mui-popup-text').remove()
				document.querySelector('.mui-popup-input').innerHTML = '<input type="password" autofocus="" placeholder="请输入旧密码"><input type="password" placeholder="请输入新密码">'
				function callback(e){
					if(e.index==0) return;
					
					var passData = {
						oldPass:$('.mui-popup-input>input')[0].value,
						newPass:$('.mui-popup-input>input')[1].value
					}
					
					//验证
					if(passData.oldPass.trim()=='' || passData.newPass.trim()==''){
						$.alert("旧密码和新密码为必填项！")
						return;
					}
					
					var aaa = $api.resetPass()
					console.log(aaa)
				}
			}
		}
	}).$mount("#app")
})(mui, document)
